/* ==============================================
   链接提交与管理 CSS
   ============================================== */

/* ---- 通用 ---- */
.daohang-submit-wrap,
.daohang-my-links-wrap {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.submit-header {
    text-align: center;
    margin-bottom: 30px;
}

.submit-header h1 {
    font-size: 26px;
    color: #333;
    margin-bottom: 8px;
}

.submit-desc {
    color: #888;
    font-size: 14px;
}

/* ---- Tabs ---- */
.submit-tabs {
    display: flex;
    border-bottom: 2px solid #e8e8e8;
    margin-bottom: 25px;
}

.submit-tabs .tab-link {
    padding: 12px 24px;
    font-size: 15px;
    color: #666;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.submit-tabs .tab-link:hover {
    color: #0389ff;
}

.submit-tabs .tab-link.active {
    color: #0389ff;
    border-bottom-color: #0389ff;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ---- Form Styles ---- */
.daohang-submit-form .form-row {
    margin-bottom: 18px;
}

.daohang-submit-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #444;
    margin-bottom: 6px;
}

.daohang-submit-form .widefat {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafafa;
}

.daohang-submit-form .widefat:focus {
    border-color: #0389ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(3,137,255,0.1);
    background: #fff;
}

.daohang-submit-form textarea.widefat {
    resize: vertical;
}

.daohang-submit-form select[multiple] {
    height: 100px;
}

/* Input with button */
.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-submit {
    background: #0389ff;
    color: #fff;
}

.btn-submit:hover {
    background: #0270d4;
    color: #fff;
}

.btn-fetch {
    background: #6c757d;
    color: #fff;
    white-space: nowrap;
    padding: 10px 16px;
}

.btn-fetch:hover {
    background: #5a6268;
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    background: #f0f0f0;
    color: #555;
}

.btn-sm:hover {
    background: #e0e0e0;
}

/* ---- Fetch Status ---- */
.fetch-status {
    margin-top: 6px;
    font-size: 13px;
}

.fetch-status.fetching {
    color: #0389ff;
}

.fetch-status.success {
    color: #28a745;
}

.fetch-status.error {
    color: #dc3545;
}

.fetch-status .error-detail {
    display: block;
    margin-top: 4px;
    padding: 8px;
    background: #fff5f5;
    border-radius: 4px;
    border: 1px solid #fcc;
}

/* ---- Image Preview ---- */
.image-preview {
    margin-top: 6px;
}

.image-preview img {
    max-width: 80px;
    max-height: 80px;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* ---- Half Row ---- */
.form-row-half {
    display: flex;
    gap: 20px;
}

.form-row-half .half-field {
    flex: 1;
}

/* ---- Category Suggest ---- */
.field-suggest {
    margin-top: 4px;
    font-size: 12px;
    color: #28a745;
}

/* ---- Advanced Toggle ---- */
.form-advanced-toggle {
    margin-top: 5px;
}

.advanced-toggle {
    color: #999;
    font-size: 13px;
    text-decoration: none;
}

.advanced-toggle:hover {
    color: #0389ff;
}

/* ---- Submit Result ---- */
.submit-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
}

.result-success {
    text-align: center;
    padding: 20px;
}

.result-success .fa-check-circle {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 10px;
}

.result-success h3 {
    color: #333;
    margin-bottom: 15px;
}

.result-actions {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.result-meta {
    margin: 10px 0;
    color: #666;
    font-size: 13px;
}

.result-qr img {
    border-radius: 8px;
    border: 2px solid #eee;
}

/* ---- Batch Upload ---- */
.batch-intro {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.batch-intro ul {
    margin: 8px 0 0 20px;
}

.batch-intro ul li {
    margin-bottom: 4px;
    font-size: 13px;
    color: #666;
}

.batch-intro code {
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.batch-limit {
    color: #e67e22;
    font-weight: 600;
    margin-top: 8px;
}

.batch-method {
    margin-bottom: 20px;
}

.batch-method h3 {
    font-size: 15px;
    color: #444;
    margin-bottom: 8px;
}

.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #0389ff;
    background: #f0f7ff;
}

.file-upload-area i {
    color: #ccc;
    margin-bottom: 10px;
}

.file-upload-area p {
    color: #999;
    font-size: 13px;
}

.file-info {
    padding: 8px 12px;
    background: #f0f7ff;
    border-radius: 4px;
    font-size: 13px;
    color: #0389ff;
}

/* ---- Batch Result ---- */
.batch-result {
    margin-top: 20px;
}

.batch-result .result-summary {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.batch-result .result-success-count {
    background: #d4edda;
    color: #155724;
}

.batch-result .result-error-list {
    max-height: 300px;
    overflow-y: auto;
}

.batch-result .result-error-item {
    padding: 6px 10px;
    font-size: 12px;
    color: #721c24;
    background: #f8d7da;
    border-radius: 3px;
    margin-bottom: 4px;
}

/* ---- My Links ---- */
.my-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.my-links-header h1 {
    font-size: 22px;
    color: #333;
}

/* Filter */
.my-links-filter {
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-item {
    flex: 1;
    min-width: 150px;
}

.filter-item input,
.filter-item select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* Batch Actions */
.batch-actions {
    background: #f8f9fa;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.selected-count {
    font-size: 13px;
    color: #666;
    margin-right: 10px;
}

/* Link List */
.my-links-list .loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Link Row */
.link-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
    background: #fff;
}

.link-row:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.link-row.selected {
    border-color: #0389ff;
    background: #f0f7ff;
}

.link-checkbox {
    margin-right: 14px;
}

.link-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.link-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    margin-right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-icon img {
    max-width: 32px;
    max-height: 32px;
    border-radius: 3px;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}

.link-title a {
    color: #333;
    text-decoration: none;
}

.link-title a:hover {
    color: #0389ff;
}

.link-url {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.link-url a {
    color: #999;
    text-decoration: none;
}

.link-url a:hover {
    color: #0389ff;
}

.link-meta {
    font-size: 12px;
    color: #999;
}

.link-meta span {
    margin-right: 12px;
}

.meta-status {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.status-publish { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-draft { background: #e2e3e5; color: #383d41; }
.status-future { background: #cce5ff; color: #004085; }

.badge-dead {
    display: inline-block;
    padding: 1px 6px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 6px;
}

.link-actions {
    display: flex;
    gap: 6px;
    margin-left: 10px;
    flex-shrink: 0;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #999;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f0f0f0;
    color: #333;
}

.btn-check-link:hover { color: #e67e22; }
.btn-delete-link:hover { color: #e74c3c; }

/* No Links */
.no-links {
    text-align: center;
    padding: 60px 20px;
    color: #ccc;
}

.no-links p {
    margin: 15px 0;
    font-size: 16px;
    color: #999;
}

/* ---- Pagination ---- */
.my-links-pagination {
    text-align: center;
    margin-top: 20px;
}

.my-links-pagination .page-btn {
    display: inline-block;
    padding: 6px 14px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

.my-links-pagination .page-btn:hover {
    border-color: #0389ff;
    color: #0389ff;
}

.my-links-pagination .page-btn.active {
    background: #0389ff;
    color: #fff;
    border-color: #0389ff;
}

.my-links-pagination .page-btn.disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---- Modal ---- */
.daohang-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 480px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.modal-close {
    border: none;
    background: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #eee;
    text-align: right;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-cancel {
    background: #f0f0f0;
    color: #555;
}

.modal-cancel:hover {
    background: #e0e0e0;
}

/* ---- Spinner ---- */
.spinner {
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;
    color: #0389ff;
}

/* ---- Responsive ---- */
@media only screen and (max-width: 768px) {
    .daohang-submit-wrap,
    .daohang-my-links-wrap {
        padding: 15px;
    }

    .submit-tabs .tab-link {
        padding: 10px 14px;
        font-size: 13px;
    }

    .form-row-half {
        flex-direction: column;
        gap: 0;
    }

    .input-with-btn {
        flex-direction: column;
    }

    .my-links-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .filter-row {
        flex-direction: column;
    }

    .filter-item {
        min-width: auto;
    }

    .link-row {
        flex-wrap: wrap;
        padding: 12px;
    }

    .link-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
        margin-left: 0;
    }
}
