/* Criteria Management - Mobile First Light Theme (Morandi) */

/* Vue.js v-cloak (必需) */
[v-cloak] {
    display: none !important;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366F1;        /* Brand Indigo */
    --primary-dark: #4F46E5;
    --bg-body: #F3F4F6;        /* Light Gray Background */
    --bg-surface: #FFFFFF;     /* White Surface */
    --bg-input: #F9FAFB;       /* Light Input Background */
    --text-primary: #1F2937;   /* Deep Gray Text */
    --text-secondary: #6B7280; /* Medium Gray Text */
    --border: #E5E7EB;         /* Light Border */
    --success: #10B981;
    --danger: #EF4444;
    --shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.01);
}

html {
    height: 100%;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100%;
    width: 100%;
}

/* Container */
.mobile-container {
    height: 100%;
    max-width: 600px; /* 限制最大宽度，适合手机/树莓派 */
    margin: 0 auto;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0,0,0,0.05); /* 桌面模式下的阴影 */
}

/* Views */
.view-list, .view-detail, .view-upload {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
    z-index: 1;
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-in { animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 2; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* Header */
.mobile-header {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 10;
}

.mobile-header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
    color: var(--text-primary);
}

.btn-icon-back, .btn-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-icon-back:hover, .btn-icon:hover {
    background-color: rgba(0,0,0,0.05);
}

.btn-icon-danger {
    background: none;
    border: none;
    color: var(--danger);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-icon-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Scrollable Content */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px; /* FAB space */
}

.criteria-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.criteria-card:active {
    transform: scale(0.98);
}

.active-card {
    border-color: var(--primary);
    background: #F5F3FF; /* Light indigo bg */
}

.active-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.card-title {
    font-size: 16px;
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.status-badge {
    font-size: 10px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin-left: 8px;
    font-weight: 500;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.meta-tag {
    background: var(--bg-body);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* FAB Button */
.fab-btn {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.5);
}

.fab-btn:active {
    transform: scale(0.95);
}

/* Detail View */
.detail-content {
    background: var(--bg-body);
}

.detail-card {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    min-height: 100%;
    box-shadow: var(--shadow);
}

.detail-info {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.detail-info h2 {
    font-size: 22px;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.detail-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

.badge-green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-gray { background: var(--bg-body); color: var(--text-secondary); }

.detail-meta p {
    margin: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.action-bar {
    margin-bottom: 24px;
}

.btn-block-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-block-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

.btn-block-primary:active {
    background: var(--primary-dark);
    transform: translateY(0);
}

.btn-block-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Markdown */
.markdown-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
}
.markdown-body h1, .markdown-body h2 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--primary);
    font-weight: 600;
}
.markdown-body ul {
    padding-left: 20px;
    color: var(--text-primary);
}
.markdown-body blockquote {
    border-left: 4px solid var(--primary);
    background: #F5F3FF;
    margin: 16px 0;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    color: #4F46E5;
}
.markdown-body code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--primary);
    font-size: 0.9em;
}

/* Upload View */
.tab-pills {
    display: flex;
    background: #E5E7EB;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 24px;
}

.pill {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.pill.active {
    background: #FFFFFF;
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.file-drop-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s;
}

.file-drop-zone:hover {
    border-color: var(--primary);
    background: #F5F3FF;
}

.icon-cloud-big {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: var(--primary);
    opacity: 0.8;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.mobile-input, .mobile-textarea {
    width: 100%;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.2s;
}

.mobile-input:focus, .mobile-textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mobile-textarea {
    min-height: 200px;
    resize: none;
    line-height: 1.6;
}

/* Overlay */
.mobile-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-box {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    width: 80%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.spinner-small.danger {
    border-color: rgba(239, 68, 68, 0.2);
    border-top-color: var(--danger);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Empty State */
.empty-state-mobile {
    text-align: center;
    padding-top: 100px;
    color: var(--text-secondary);
}
.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Toast */
.mobile-toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.mobile-toast {
    background: rgba(31, 41, 55, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    backdrop-filter: blur(4px);
}

.mobile-toast.success { background: rgba(16, 185, 129, 0.9); }
.mobile-toast.error { background: rgba(239, 68, 68, 0.9); }

.toast-fade-enter-active, .toast-fade-leave-active {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast-fade-enter-from, .toast-fade-leave-to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

/* Checkbox Group */
.checkbox-group {
    margin-top: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-text {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.help-text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    padding-left: 30px;
}

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.confirm-box {
    background: var(--bg-surface);
    border-radius: 16px;
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.confirm-buttons button {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-cancel {
    background: var(--bg-input);
    color: var(--text-secondary);
}

.btn-cancel:hover {
    background: var(--border);
}

.btn-confirm {
    background: var(--primary);
    color: white;
}

.btn-confirm:hover {
    background: var(--primary-dark);
}

.btn-confirm.danger {
    background: var(--danger);
}

.btn-confirm.danger:hover {
    background: #DC2626;
}

.btn-confirm.primary {
    background: var(--primary);
}

/* Modal Transition */
.modal-fade-enter-active,
.modal-fade-leave-active {
    transition: all 0.25s ease;
}

.modal-fade-enter-from,
.modal-fade-leave-to {
    opacity: 0;
}

.modal-fade-enter-from .confirm-box,
.modal-fade-leave-to .confirm-box {
    transform: scale(0.9);
}
