:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text: #1e293b;
    --text-muted: #64748b;
    --safe: #10b981;
    --caution: #f59e0b;
    --critical: #ef4444;
    --border: #e2e8f0;
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
}

body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 800px;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

/* Upload Section */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.icon-upload {
    width: 48px;
    height: 48px;
    color: var(--primary);
    margin-bottom: 1rem;
}

.drop-zone p {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.drop-zone span {
    color: var(--text-muted);
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.dashboard-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.risk-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1.1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.risk-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.risk-item {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.risk-item:hover {
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.risk-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.item-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.chevron {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.risk-item.active .chevron {
    transform: rotate(180deg);
}

.risk-content {
    padding: 0 1.5rem 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.quote-box, .advice-box {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f8fafc;
    border-left: 4px solid var(--border);
}

.quote-box {
    border-left-color: var(--primary);
}

.quote-text {
    font-style: italic;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.advice-text {
    margin-top: 0.5rem;
}

.btn-copy {
    background: var(--critical);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-copy:hover {
    opacity: 0.9;
}

.actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--text-muted);
    color: white;
}

/* Status Colors */
.status-safe { background-color: var(--safe); }
.status-caution { background-color: var(--caution); }
.status-critical { background-color: var(--critical); }

.risk-badge.SAFE { background-color: rgba(16, 185, 129, 0.1); color: var(--safe); }
.risk-badge.CAUTION { background-color: rgba(245, 158, 11, 0.1); color: var(--caution); }
.risk-badge.CRITICAL { background-color: rgba(239, 68, 68, 0.1); color: var(--critical); }

.hidden { display: none !important; }

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    z-index: 100;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 500px; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
