/* 广告购买页面专用样式 */
.ad-purchase-container {
    max-width: 1800px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ad-purchase-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.ad-purchase-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.ad-purchase-header p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group label .required {
    color: #ff4444;
    margin-left: 3px;
}

/* 统一所有输入框、下拉框和验证码的高度为44px */
.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
    height: 44px;
    line-height: 1.5;
}

/* 下拉框样式 - 高度与输入框一致 */
select.form-control {
    height: 44px;
    padding: 10px 15px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 15px center;
    background-size: 16px;
    padding-right: 40px;
}

select.form-control option {
    padding: 10px 15px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #E76031;
    box-shadow: 0 0 0 2px rgba(231, 96, 49, 0.2);
}

.form-control.error {
    border-color: #ff4444;
}

.form-control.success {
    border-color: #4CAF50;
}

.form-tips {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 12px;
    line-height: 1.5;
    padding: 4px 8px;
    border-radius: 2px;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    z-index: 100;
    white-space: nowrap;
    display: none;
    animation: fadeInUp 0.3s ease;
}

.form-tips.error {
    background: #fef0f0;
    border-color: #f56c6c;
    color: #f56c6c;
}

.form-tips.success {
    background: #f0f9eb;
    border-color: #67c23a;
    color: #67c23a;
}

.form-tips::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 10px;
    height: 10px;
    background: inherit;
    border-left: 1px solid inherit;
    border-top: 1px solid inherit;
    transform: rotate(45deg);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message {
    color: #ff4444;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background: #E76031;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    height: 48px;
}

.submit-btn:hover {
    background: #EC4E17;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.back-home {
    text-align: center;
    margin-top: 20px;
}

.back-home a {
    color: #4CAF50;
    text-decoration: none;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.error-alert {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

/* 验证码样式 - 高度与输入框一致 */
.captcha-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input {
    flex: 1;
    height: 44px !important; /* 统一高度为44px */
}

.captcha-img {
    width: 100px;
    height: 44px; /* 与输入框高度一致 */
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 确保验证码图片容器中的img高度正确 */
.captcha-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 广告信息展示 */
.ad-info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ad-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
}

.ad-info-label {
    font-weight: 600;
    min-width: 100px;
}

.ad-info-value {
    flex: 1;
    text-align: right;
    font-weight: 500;
}

.ad-price {
    font-size: 24px;
    color: #ffd700;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
}

/* 统计信息样式 */
.stats-container {
    margin-top: 15px;
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stats-row {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
}

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

.stat-value {
    font-size: 16px;
    font-weight: bold;
    margin-left: 5px;
}

.stat-value.total { color: #4CAF50; }
.stat-value.active { color: #2196F3; }
.stat-value.available { color: #FF9800; }

/* 投放流程样式 */
.process-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.process-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #E76031;
    z-index: 1;
}

.step {
    text-align: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    background: #E76031;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
}

.step-text {
    font-size: 14px;
    color: #666;
}

/* 协议复选框样式 - 修复间距问题 */
.protocol-checkbox-group {
    margin: 25px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #E76031;
}

/* 重置Bootstrap的form-check默认样式 */
.protocol-checkbox-group .form-check {
    padding-left: 0 !important; /* 清除默认左边距 */
    margin-left: 0 !important; /* 清除默认左边距 */
    display: flex;
    align-items: center;
    min-height: 22px;
}

/* 使用更精确的选择器覆盖Bootstrap样式 */
.protocol-checkbox-group input[type="checkbox"] {
    margin-left: 0 !important;
    margin-right: 8px; /* 适当间距 */
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

/* 或者完全重写样式避免Bootstrap干扰 */
.protocol-agreement {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.protocol-agreement-checkbox {
    margin: 0;
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.protocol-agreement-label {
    cursor: pointer;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.protocol-agreement-label a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.protocol-agreement-label a:hover {
    text-decoration: underline;
}

.protocol-agreement-label .required {
    color: #ff4444;
    margin-left: 3px;
}

.form-check {
    padding-left: 1.75rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    min-height: 24px;
}

.form-check-input {
    position: relative;
    margin-left: -1.75rem;
    margin-top: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
    padding-left: 10px;
    margin-top: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* 修复复选框垂直居中问题 */
.form-check-input,
.form-check-label {
    vertical-align: middle;
}

.form-check-label a {
    vertical-align: baseline;
}

/* 更精确的复选框对齐方案 */
.form-check {
    position: relative;
}

.form-check-input {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

.form-check-label {
    padding-left: 28px;
    display: block;
    line-height: 1.5;
    min-height: 20px;
    padding-top: 1px;
}

/* 或者使用flexbox的解决方案 */
.form-check.flex-solution {
    display: flex;
    align-items: flex-start;
}

.form-check.flex-solution .form-check-input {
    position: static;
    margin-top: 4px;
    margin-right: 10px;
    transform: none;
}

.form-check.flex-solution .form-check-label {
    padding-left: 0;
    flex: 1;
}

.protocol-preview {
    margin-top: 10px;
    padding: 12px;
    background: rgba(231, 96, 49, 0.08);
    border-radius: 4px;
    border-left: 3px solid #E76031;
}

.protocol-preview p {
    margin-bottom: 8px;
    font-weight: 500;
    color: #E76031;
    font-size: 14px;
}

.protocol-preview ul {
    margin: 0;
    padding-left: 18px;
}

.protocol-preview li {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 3px;
    color: #555;
}

/* 协议弹窗样式 */
.protocol-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
}

.protocol-modal .modal-title {
    font-weight: 600;
}

.protocol-modal .modal-body {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 25px;
}

.protocol-section {
    margin-bottom: 25px;
}

.protocol-section h5 {
    font-size: 16px;
    font-weight: 600;
    border-left: 4px solid;
    padding-left: 12px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.protocol-section ul {
    padding-left: 25px;
    margin-bottom: 0;
}

.protocol-section li {
    margin-bottom: 8px;
    color: #555;
    line-height: 1.6;
    position: relative;
}

.protocol-section li:before {
    content: "•";
    color: #E76031;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

.protocol-footer {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    border-top: 2px solid #e9ecef;
}

.protocol-footer p {
    margin-bottom: 8px;
    color: #666;
}

.protocol-footer .text-small {
    font-size: 12px;
    color: #999;
    margin-bottom: 0;
}

/* 日夜模式适配 */
.io-black-mode .ad-purchase-container {
    background: #2d2d2d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.io-black-mode .ad-purchase-container label,
.io-black-mode .ad-purchase-container h1,
.io-black-mode .ad-purchase-container p {
    color: #e0e0e0;
}

.io-black-mode .protocol-checkbox-group {
    background: #383838;
    border-left-color: #E76031;
}

.io-black-mode .form-check-label {
    color: #e0e0e0;
}

.io-black-mode .protocol-preview {
    background: rgba(231, 96, 49, 0.12);
    border-left-color: #E76031;
}

.io-black-mode .protocol-preview p {
    color: #ff9966;
}

.io-black-mode .protocol-preview li {
    color: #ccc;
}

.io-black-mode .form-control,
.io-black-mode select.form-control,
.io-black-mode .captcha-img {
    background-color: #383838;
    border-color: #444;
    color: #e0e0e0;
}

.io-black-mode .form-control:focus {
    border-color: #E76031;
    box-shadow: 0 0 0 2px rgba(231, 96, 49, 0.2);
}

.io-black-mode .stats-container {
    background: #383838;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.io-black-mode .stat-label {
    color: #ccc;
}

.io-black-mode .protocol-modal .modal-content {
    background: #2d2d2d;
    color: #e0e0e0;
}

.io-black-mode .protocol-section h5 {
    color: #fff;
}

.io-black-mode .protocol-section li {
    color: #ccc;
}

.io-black-mode .protocol-footer {
    background: #383838;
    color: #ccc;
}

.io-black-mode .protocol-footer p {
    color: #ccc;
}

.io-black-mode .protocol-footer .text-small {
    color: #aaa;
}