/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

/* 容器 */
.container {
    max-width: 400px;
    margin: 0 auto;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: fadeInUp 0.8s ease-out;
}

.subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 主要内容 */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cardAppear 0.8s ease-out 0.4s both;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

/* 内容显示 */
.content-display {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
    padding-left: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    padding: 20px;
}

.loading {
    color: #666;
    font-style: italic;
}

/* 按钮组 */
.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 120px;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.copy-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
}

.admin-btn {
    background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

/* 底部 */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
}

.footer p {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: between;
    align-items: center;
}

.modal-header h3 {
    color: #333;
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 25px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.form-section textarea,
.form-section input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color 0.3s ease;
}

.form-section textarea:focus,
.form-section input:focus {
    outline: none;
    border-color: #667eea;
}

.add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.update-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.delete-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    border-radius: 8px;
}

.content-list {
    max-height: 200px;
    overflow-y: auto;
}

.content-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 4px solid #4ECDC4;
}

.content-text {
    margin-bottom: 10px;
    color: #333;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* iPhone 13/14/15 专项适配 */
@media screen and (max-width: 430px) {
    body {
        padding: 15px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .card {
        padding: 25px 20px;
    }
    
    .content-display {
        font-size: 16px;
        min-height: 100px;
        padding: 15px;
    }
    
    .btn {
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .actions {
        flex-direction: column;
    }
}

/* 华为 P/Mate 系列适配 */
@media screen and (min-width: 431px) and (max-width: 500px) {
    .container {
        max-width: 380px;
    }
}

/* 横屏适配 */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .header {
        margin-bottom: 20px;
        padding-top: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    .content-display {
        min-height: 80px;
        margin-bottom: 20px;
        font-size: 16px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .card {
        background: #2d3748;
        color: white;
    }
    
    .content-display {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        color: white;
        border-left-color: #667eea;
    }
    
    .modal-content {
        background: #2d3748;
        color: white;
    }
    
    .modal-header {
        border-bottom-color: #4a5568;
    }
    
    .form-section textarea,
    .form-section input {
        background: #4a5568;
        border-color: #4a5568;
        color: white;
    }
    
    .content-item {
        background: #4a5568;
        color: white;
    }
}