/* Apple Certificate Checker - 苹果轻拟态风格 */
:root {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-blue: #0071e3;
    --status-green: #34c759;
    --status-yellow: #ffcc00;
    --status-orange: #ff9500;
    --status-red: #ff3b30;
    --status-gray: #8e8e93;
    --shadow-light: rgba(255, 255, 255, 0.8);
    --shadow-dark: rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

.container { max-width: 800px; margin: 0 auto; padding: 40px 20px; }

.header { text-align: center; margin-bottom: 32px; }
.header h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 8px; }
.header p { color: var(--text-secondary); font-size: 15px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
}

/* 双上传区域 */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.upload-box { display: flex; flex-direction: column; }

.upload-area {
    border: 2px dashed #d2d2d7;
    border-radius: var(--radius-sm);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area:hover, .upload-area.dragover { border-color: var(--accent-blue); background: rgba(0, 113, 227, 0.02); }
.upload-area.has-file { border-color: var(--status-green); border-style: solid; }

.upload-icon { width: 36px; height: 36px; margin-bottom: 12px; opacity: 0.5; }
.upload-icon svg { width: 100%; height: 100%; stroke: var(--text-secondary); }

.upload-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-secondary); }
.file-name { font-size: 12px; color: var(--status-green); font-weight: 500; margin-top: 8px; word-break: break-all; }

.input-group { margin-top: 12px; }
.input-field {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-primary);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}
.input-field:focus { outline: none; box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light), 0 0 0 2px rgba(0, 113, 227, 0.2); }
.input-field::placeholder { color: var(--text-secondary); }

.file-input { display: none; }

/* 按钮 */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 4px 4px 12px rgba(0, 113, 227, 0.3), -4px -4px 12px var(--shadow-light);
}
.btn-primary:hover:not(:disabled) { background: #0077ed; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 加载 */
.loading { display: none; text-align: center; padding: 32px; }
.loading.show { display: block; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--bg-color); border-top-color: var(--accent-blue); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text-secondary); }

/* 错误 */
.error-box { display: none; padding: 14px 18px; background: rgba(255, 59, 48, 0.08); border-radius: var(--radius-sm); border-left: 4px solid var(--status-red); margin-top: 16px; }
.error-box.show { display: block; }
.error-box p { font-size: 14px; color: var(--status-red); }

/* 结果区域 */
.result-section { display: none; margin-top: 24px; }
.result-section.show { display: block; }

/* 综合结果 */
.result-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}
.result-summary.safe { background: rgba(52, 199, 89, 0.1); }
.result-summary.warning { background: rgba(255, 149, 0, 0.1); }
.result-summary.danger { background: rgba(255, 59, 48, 0.1); }

.summary-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.result-summary.safe .summary-icon { background: var(--status-green); color: #fff; }
.result-summary.warning .summary-icon { background: var(--status-orange); color: #fff; }
.result-summary.danger .summary-icon { background: var(--status-red); color: #fff; }
.summary-icon::before { font-family: system-ui; }
.result-summary.safe .summary-icon::before { content: "✓"; }
.result-summary.warning .summary-icon::before { content: "!"; }
.result-summary.danger .summary-icon::before { content: "✕"; }

.summary-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.result-summary.safe .summary-title { color: var(--status-green); }
.result-summary.warning .summary-title { color: var(--status-orange); }
.result-summary.danger .summary-title { color: var(--status-red); }
.summary-desc { font-size: 13px; color: var(--text-secondary); }

/* 详细卡片 */
.result-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-card { background: var(--bg-color); border-radius: var(--radius-sm); padding: 16px; }
.detail-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.detail-title { font-size: 14px; font-weight: 600; }

/* 状态标签 */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }

.status-badge.green { background: rgba(52, 199, 89, 0.15); color: var(--status-green); }
.status-badge.green .status-dot { background: var(--status-green); }
.status-badge.orange { background: rgba(255, 149, 0, 0.15); color: var(--status-orange); }
.status-badge.orange .status-dot { background: var(--status-orange); }
.status-badge.red { background: rgba(255, 59, 48, 0.15); color: var(--status-red); }
.status-badge.red .status-dot { background: var(--status-red); }
.status-badge.gray { background: rgba(142, 142, 147, 0.15); color: var(--status-gray); }
.status-badge.gray .status-dot { background: var(--status-gray); }

/* 信息列表 */
.info-list { display: flex; flex-direction: column; gap: 8px; }
.info-item { display: flex; justify-content: space-between; align-items: flex-start; font-size: 13px; }
.info-label { color: var(--text-secondary); flex-shrink: 0; }
.info-value { font-weight: 500; text-align: right; word-break: break-all; max-width: 60%; }

/* 警告框 */
.warning-box { padding: 14px 18px; background: rgba(255, 149, 0, 0.08); border-radius: var(--radius-sm); border-left: 4px solid var(--status-orange); margin-top: 16px; }
.warning-box p { font-size: 13px; color: var(--status-orange); line-height: 1.5; }

/* 底部 */
.footer-card { padding: 16px 20px; text-align: center; }
.footer-card p { font-size: 12px; color: var(--text-secondary); }

/* 状态颜色 */
.status-green { color: var(--status-green); font-weight: 500; }
.status-red { color: var(--status-red); font-weight: 500; }
.status-orange { color: var(--status-orange); font-weight: 500; }

/* 登录框 */
.login-form { text-align: center; padding: 20px 0; }
.login-title { font-size: 16px; color: var(--text-secondary); margin-bottom: 20px; }
.login-form .input-group { max-width: 280px; margin: 0 auto 16px; }
.login-form .btn { width: 100%; max-width: 280px; }
.login-error { color: var(--status-red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* 响应式 */
@media (max-width: 600px) {
    .container { padding: 20px 16px; }
    .card { padding: 20px; }
    .header h1 { font-size: 22px; }
    .upload-grid, .result-details { grid-template-columns: 1fr; }
    .info-item { flex-direction: column; gap: 2px; }
    .info-value { text-align: left; max-width: 100%; }
}
