/* Apple ID 外借管理面板 - 样式文件 */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
    line-height: 1.5;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 8px;
}

.header p {
    color: #86868b;
    font-size: 16px;
}

/* 统计卡片网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: #86868b;
    font-size: 14px;
}

/* 状态颜色 */
.ready { color: #34c759; }
.unused { color: #ff9500; }
.total { color: #007aff; }
.rented { color: #c2185b; }
.aftercare { color: #3f51b5; }
.freeze { color: #0277bd; }

/* 区域样式 */
.section {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.section-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
}

.section-content {
    padding: 0;
}

/* 控制面板 */
.controls {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e7;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* 按钮样式 */
.btn {
    background: #007aff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn:hover {
    background: #0056cc;
}

.btn-secondary {
    background: #f2f2f7;
    color: #1d1d1f;
}

.btn-secondary:hover {
    background: #e5e5ea;
}

/* 输入框样式 */
.input {
    padding: 8px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
}

.input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

/* 账号列表 */
.account-grid {
    display: grid;
    gap: 1px;
    background: #e5e5e7;
}

.account-item {
    background: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.account-item:hover {
    background: #f9f9f9;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 状态徽章 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-ready {
    background: #d1f2eb;
    color: #00875a;
}

.status-unused {
    background: #fff4e6;
    color: #b25000;
}

.status-rented {
    background: #fce4ec;
    color: #c2185b;
}

.status-aftercare {
    background: #e8eaf6;
    color: #3f51b5;
}

.status-freeze {
    background: #e3f2fd;
    color: #0277bd;
}

.account-email {
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

/* 加载和错误状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #86868b;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 16px 24px;
    border-radius: 8px;
    margin: 16px 24px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e7;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close {
    font-size: 24px;
    cursor: pointer;
    color: #86868b;
    transition: color 0.2s;
}

.close:hover {
    color: #1d1d1f;
}

/* 详情项 */
.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f7;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 500;
    color: #86868b;
    min-width: 80px;
}

.detail-value {
    font-family: monospace;
    color: #1d1d1f;
    word-break: break-all;
    text-align: right;
    flex: 1;
    margin-left: 12px;
}

/* 历史记录 */
.history-section {
    margin-top: 24px;
}

.history-section h4 {
    margin-bottom: 16px;
    color: #1d1d1f;
    font-size: 16px;
}

.history-item {
    padding: 16px;
    border: 1px solid #e5e5e7;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #fafafa;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-meta {
    font-size: 12px;
    color: #86868b;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #86868b;
    background: #fafafa;
    border-radius: 8px;
}

/* 用户链接 */
.user-link {
    color: #007aff;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.user-link:hover {
    color: #0056cc;
    text-decoration: underline;
}

/* 租用历史预览样式 */
.rent-history-preview {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    font-size: 13px;
}

.rent-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
}

.rent-label {
    font-weight: 500;
    color: #495057;
    min-width: 60px;
}

.rent-value {
    color: #212529;
    font-family: monospace;
    font-size: 12px;
}

.rent-meta {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}

/* 已借出账号项特殊样式 */
.account-item-rented {
    border-left: 4px solid #c2185b;
}

.account-item-rented:hover {
    border-left-color: #ad1457;
}

/* 各状态账号项特殊样式 */
/*.account-item-ready {*/
/*    border-left: 4px solid #34c759;*/
/*}*/

/*.account-item-ready:hover {*/
/*    border-left-color: #28a745;*/
/*}*/

/*.account-item-unused {*/
/*    border-left: 4px solid #ff9500;*/
/*}*/

/*.account-item-unused:hover {*/
/*    border-left-color: #e68900;*/
/*}*/

.account-item-rented {
    border-left: 4px solid #c2185b;
}

.account-item-rented:hover {
    border-left-color: #ad1457;
}

.account-item-aftercare {
    border-left: 4px solid #3f51b5;
}

.account-item-aftercare:hover {
    border-left-color: #303f9f;
}

.account-item-freeze {
    border-left: 4px solid #0277bd;
}

.account-item-freeze:hover {
    border-left-color: #01579b;
}

/* 搜索高亮 */
.highlight-search {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 4px;
    animation: highlight-fade 3s ease-out;
}

@keyframes highlight-fade {
    0% { background: #ffeb3b; }
    100% { background: transparent; }
}

/* 过滤指示器 */

/* 配置区域样式 */
.config-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.btn-config {
    background: #f2f2f7;
    color: #1d1d1f;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-config:hover {
    background: #e5e5ea;
}

.config-form {
    padding: 20px 24px;
    border-top: 1px solid #e5e5e7;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1d1d1f;
    font-size: 14px;
}

.form-group .input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 6px;
    font-size: 14px;
}

.form-group .input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #86868b;
    padding: 4px;
}

.form-group {
    position: relative;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary {
    background: #007aff;
    color: white;
}

.btn-success {
    background: #34c759;
    color: white;
}

.btn-warning {
    background: #ff9500;
    color: white;
}

.btn-primary:hover {
    background: #0056cc;
}

.btn-success:hover {
    background: #28a745;
}

.btn-warning:hover {
    background: #e68900;
}

/* 配置状态样式 */
.config-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.config-status.success {
    background: #d1f2eb;
    color: #00875a;
    border: 1px solid #b3e5d1;
}

.config-status.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.config-status.loading {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

/* 逆向工具样式 */
.reverse-tool-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px 24px;
}

.reverse-tool-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
}

.reverse-tool {
    margin-top: 16px;
}

.reverse-result {
    margin-top: 16px;
}

.reverse-success {
    background: #d1f2eb;
    border: 1px solid #b3e5d1;
    border-radius: 8px;
    padding: 16px;
}

.reverse-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 16px;
    color: #c62828;
}

.reverse-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reverse-item:last-child {
    margin-bottom: 0;
}

.reverse-label {
    font-weight: 500;
    color: #1d1d1f;
}

.reverse-value {
    font-family: monospace;
    font-weight: 600;
    word-break: break-all;
}

.reverse-value.highlight {
    background: #ffeb3b;
    padding: 2px 6px;
    border-radius: 4px;
    color: #1d1d1f;
}

.reverse-hint {
    margin-top: 8px;
    margin-bottom: 4px;
    font-weight: 500;
}

.reverse-hints {
    margin-left: 20px;
    margin-top: 4px;
}

.reverse-hints li {
    margin-bottom: 4px;
}

/* 缓存信息样式 */
.cache-info {
    margin-top: 16px;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e5e5e7;
}

.cache-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.cache-stat {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}

.cache-label {
    font-weight: 500;
    color: #86868b;
    font-size: 14px;
}

.cache-value {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 14px;
}

/* 用户ID逆向样式 */
.hash-id {
    color: #007aff;
    font-size: 12px;
    font-weight: 400;
    opacity: 0.8;
    cursor: help;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls .input {
        min-width: auto;
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cache-stats {
        grid-template-columns: 1fr;
    }

    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        max-width: none;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-value {
        text-align: left;
        margin-left: 0;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 24px;
    }

    .stat-number {
        font-size: 24px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .account-email {
        font-size: 12px;
    }
}
