/* Amazon 工具箱 - 样式表 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f0f2f5;
    color: #374151;
    min-height: 100vh;
}

/* ===== 顶部栏 ===== */
.top-bar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-logo {
    font-size: 16px;
    font-weight: 700;
    color: #3b82f6;
}
.timezone-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
}
.tz-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
}
.tz-label {
    color: #6b7280;
}
.tz-time {
    color: #111827;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ===== 站点标签栏 ===== */
.site-tabs {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}
.site-tabs-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    gap: 0;
    overflow-x: auto;
}
.site-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.site-tab:hover { color: #3b82f6; }
.site-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* ===== 主内容区 ===== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

/* 内容标签 */
.content-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}
.content-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.content-tab:hover { color: #3b82f6; }
.content-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 16px;
}
.search-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ===== 工具网格 ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 480px) { .tools-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .tools-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1024px) { .tools-grid { grid-template-columns: repeat(9, 1fr); } }

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}
.tool-card:hover {
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.tool-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s;
}
.tool-card:hover .tool-icon { transform: scale(1.05); }
.tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}
.tool-info {
    text-align: center;
}
.tool-name {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    display: block;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
}
.tool-port {
    font-size: 10px;
    color: #3b82f6;
    font-weight: 500;
}

/* ===== 站点网格 ===== */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (min-width: 480px) { .sites-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 768px) { .sites-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 1024px) { .sites-grid { grid-template-columns: repeat(12, 1fr); } }

.site-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}
.site-card:hover {
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.site-flag {
    font-size: 24px;
    margin-bottom: 4px;
}
.site-name {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
}
.site-new-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 8px;
    font-weight: 600;
    color: #fff;
    background: #ef4444;
    padding: 1px 4px;
    border-radius: 3px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-size: 14px;
}

/* ===== 底部状态栏 ===== */
.bottom-bar {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    margin-top: 24px;
}
.bottom-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}
.bottom-section {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}
.week-info, .year-days {
    font-size: 12px;
}
.countdown-section {
    gap: 16px;
}
.countdown-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.countdown-label {
    color: #6b7280;
    font-size: 11px;
}
.countdown-value {
    color: #3b82f6;
    font-weight: 600;
    font-size: 12px;
}
.rates-section {
    gap: 12px;
}
.rate-item {
    font-size: 11px;
    color: #6b7280;
}

/* ===== 管理后台 ===== */
.admin-page {
    background: #f0f2f5;
    min-height: 100vh;
}
.admin-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}
.admin-header-right {
    display: flex;
    gap: 8px;
}
.admin-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}
.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (min-width: 768px) {
    .admin-grid { grid-template-columns: 2fr 1fr; }
}
.admin-panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}
.admin-form .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 480px) {
    .admin-form .form-row { grid-template-columns: 1fr 1fr; }
}
.form-group { margin-bottom: 12px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }
.btn-block { width: 100%; }

/* 表格 */
.items-table-wrapper { overflow-x: auto; }
.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.items-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f9fafb;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}
.items-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.items-table tr:hover { background: #f9fafb; }
.item-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.item-icon-sm {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.link-cell {
    color: #3b82f6;
    text-decoration: none;
    font-size: 12px;
}
.link-cell:hover { text-decoration: underline; }
.tag {
    display: inline-block;
    padding: 2px 6px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 11px;
    color: #6b7280;
}
.tag-blue { background: #eff6ff; color: #3b82f6; }

/* 备份列表 */
.backup-list { margin-top: 12px; }
.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}
.backup-item:last-child { border-bottom: none; }
.backup-info { flex: 1; min-width: 0; }
.backup-name {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.backup-meta {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}
.backup-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.backup-form { margin-bottom: 8px; }
.empty-text { font-size: 13px; color: #9ca3af; }

/* 消息 */
.success-msg {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}
.error-msg {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ===== 登录页 ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f0f2f5;
}
.login-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 32px;
    width: 100%;
    max-width: 360px;
}
.login-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    margin-bottom: 24px;
}
.login-form .form-group { margin-bottom: 16px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .top-bar-inner { padding: 0 12px; }
    .timezone-list { gap: 8px; }
    .tz-item { font-size: 11px; }
    .site-tabs-inner { padding: 0 12px; }
    .site-tab { padding: 8px 12px; font-size: 12px; }
    .main-content { padding: 12px; }
    .content-tab { padding: 8px 14px; font-size: 13px; }
    .bottom-bar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px 12px;
    }
    .countdown-section { flex-wrap: wrap; }
    .rates-section { flex-wrap: wrap; }
}
